package com.inray.nbs.utils;

import org.junit.Before;
import org.junit.Test;

import com.zst.cb.test.TableToEntityTool;



/**
 * 反向工程工具类
 * @author Administrator
 *
 */
public class TestDBTool {
	private String packageName="com.zst.wms.bean";//将实体类生成在哪个包中
	private String packagePath="/com/zst/wms/bean/";//实体类文件生成路径
	private int DBType=1;//1为mysql或SqlServer  2为oracle
	private String DBName="zstdq";//数据库名称
	private String DBDriver="oracle.jdbc.driver.OracleDriver";//数据库驱动
	private String DBUrl="jdbc:oracle:thin:@127.0.0.1:1521:ORCL";
	private String username="zstywl";
	private String pw="team2014";
	private TableToEntityTool t=null;
	//是否生成mybatis的映射文件(com.zst.cb.mappers包)，注意：生成的文件会覆盖之前的文件,根据需要来决定是否生成。
	private boolean isMapper=true;
	private String mapperPath="/com/zst/wms/mappers/";//生成映射文件存放的路径
	@Before
	public void init(){
		t = new TableToEntityTool(packageName, packagePath, DBType, DBName, DBDriver, DBUrl, username, pw,isMapper,mapperPath);
	}
	/**
	 * 针对单个表的操作
	 */
	@Test
	public void tableToEntityByName(){
		t.tableToEntity("wms_notice");
	}
}
